function F = est_obj(est, param, data, adj_index, start_time)
global num_guess

    num_guess = num_guess + 1;
    iter_start_time = tic;

    % adjustment
    for i = adj_index
        est(i) = exp(est(i));
    end

    
%% Solve the equilibrium

    % add guess to param
    define_param_est   
        
    % constants
    define_omega_dist %firm type and density
    define_const %qgrid, phi_v, phy_y, D_F and other constants
    
    % solve the equilibrium
    eqm = solve_eqm_outer(param, const);
    define_wage_schedule %add wage schedule
    
    
%% Calculate objective function value    
    
    % calculate model moments and objfcn
    model = cal_model_moment(param, const, eqm); 
    bartik = cal_chg_bartik(param, const, eqm);     
    obj = cal_objfcn(data, model, bartik);

       
%% Print

%     fileID = fopen('../Output/Temp/temp_estimation_fullmodel.txt', 'a');
%     fprintf(fileID, 'guess = %.0f, obj = %.4f, iter_outer = %.0f, err_outer = %.6f, repeat = %.0f, iter_inner = %.0f, err_inner = %.6f, time = %.1fmin, cumtime = %.1fmin\n', ...
%         num_guess, obj, eqm.iter_outer, eqm.err_outer, eqm.repeat, eqm.iter_inner, eqm.err_inner, toc(iter_start_time)/60, toc(start_time)/60);    
%     fclose(fileID);
    fprintf('guess = %.0f, obj = %.4f, iter_outer = %.0f, err_outer = %.6f, repeat = %.0f, iter_inner = %.0f, err_inner = %.6f, time = %.1fmin, cumtime = %.1fmin\n', ...
        num_guess, obj, eqm.iter_outer, eqm.err_outer, eqm.repeat, eqm.iter_inner, eqm.err_inner, toc(iter_start_time)/60, toc(start_time)/60);    
     

%% Return

    F = obj;

    
end